package com.yx.system.service.impl;

import com.baomidou.mybatisplus.plugins.Page;
import com.yx.system.dao.TdOrderMapper;
import com.yx.system.dto.BookStatisticsDto;
import com.yx.system.entity.TdOrder;
import com.yx.system.service.TdOrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;
import java.util.Map;

@Service("tdOrderService")
@Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class)
public class TdOrderServiceImpl implements TdOrderService {

    @Autowired
    private TdOrderMapper tdOrderMapper;

    @Override
    public int deleteByPrimaryKey(Integer id) {
        return tdOrderMapper.deleteByPrimaryKey(id);
    }

    @Override
    public int insert(TdOrder record) {
        return tdOrderMapper.insert(record);
    }

    @Override
    public int insertSelective(TdOrder record) {
        return tdOrderMapper.insertSelective(record);
    }

    @Override
    public TdOrder selectByPrimaryKey(Integer id) {
        return tdOrderMapper.selectByPrimaryKey(id);
    }

    @Override
    public int updateByPrimaryKeySelective(TdOrder record) {
        return tdOrderMapper.updateByPrimaryKeySelective(record);
    }

    @Override
    public int updateByPrimaryKey(TdOrder record) {
        return tdOrderMapper.updateByPrimaryKey(record);
    }

    @Override
    public List<TdOrder> queryList(Map<String, Object> map) {
        return tdOrderMapper.queryList(map);
    }

    @Override
    public int queryTotal(Map<String, Object> map) {
        return tdOrderMapper.queryTotal(map);
    }

    @Override
    public List<TdOrder> queryAl() {
        return tdOrderMapper.queryAll();
    }

    @Override
    public TdOrder queryByBillNo(String billNo) {
        return tdOrderMapper.queryByBillNo(billNo);
    }

    @Override
    public Page<TdOrder> queryPageList(Page<TdOrder> page, Map<String, Object> map) {
        page.setRecords(tdOrderMapper.queryPageList(page, map));
        return page;
    }

    @Override
    public Page<BookStatisticsDto> sameMonth(Page<BookStatisticsDto> page, Map<String, Object> map) {
        page.setRecords(tdOrderMapper.sameMonth(page, map));
        return page;
    }

    @Override
    public Page<BookStatisticsDto> sameMonth2(Page<BookStatisticsDto> page, Map<String, Object> map) {
        page.setRecords(tdOrderMapper.sameMonth2(page, map));
        return page;
    }

    @Override
    public Page<BookStatisticsDto> allStatistics(Page<BookStatisticsDto> page, Map<String, Object> map) {
        page.setRecords(tdOrderMapper.allStatistics(page, map));
        return page;
    }


}
